package com.zsrt.java.day20161223.wrl.homework;

import org.junit.Test;

public class Work08 {
	
	/**
	 *       *
	 *     * * *
	 *   * * * * *
	 * * * * * * * *
	 *   * * * * *
	 *     * * *
	 *       *
	 */
	@Test
	public void w08(){
		//打印前4行
		for(int h = 1; h <= 4; h++){
			//打印空格
			for(int sp = 1;sp<=4-h; sp++){
				System.out.print(" ");
			}
			//打印星号
			for(int star = 1; star <= 2*h-1; star++){
				System.out.print("*");
			}
			//换行
			System.out.println();
		}
		//打印后3行
		for(int h = 1; h <=3; h++){
			for(int sp = 1;sp<=h; sp++){
				System.out.print(" ");
			}
			for(int star=1;star<=7-2*h;star++){
				System.out.print("*");
			}
			System.out.println();
		}
	}
}
